<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
$return=array();
if($_RQ['op']=='edit'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		pdo_update('core_accounts',array('syscolor'=>$postdata['syscolor']),array('uniacid'=>$_SESSION['uniacid']));
		$jy_weishop=plugin('jy_weishop')->plugin_setting('setting');
		$fields=array('indexvideo','indeximg','indeximgurl','hdps','cube','bankuai1','bankuai2','footernav','welcomehdps','share_title','share_image','share_desc','share_keywords','toplogo','pluginnav','ismerch','isnomerch','isgoodstwo','isrecommand','islikegoods',
		'isnewgoods','islivebankuai','iscoupon','iscube','isbankuai1','isswiper','noticeimg','isnotice','ishdps','issearch');
		$mydiydata=array_fields($fields,$postdata);
		$diydata=array_fields($fields,$jy_weishop);
		$postdata=array_merge($postdata,$diydata);
		/*$postdata['hdps']=$jy_weishop['hdps'];
		$postdata['cube']=$jy_weishop['cube'];
		$postdata['bankuai1']=$jy_weishop['bankuai1'];
		$postdata['bankuai2']=$jy_weishop['bankuai2'];
		$postdata['footernav']=$jy_weishop['footernav'];
		$postdata['detail_tpl']=$jy_weishop['detail_tpl'];
		$postdata['welcomehdps']=$jy_weishop['welcomehdps'];
		$postdata['share_title']=$jy_weishop['share_title'];
		$postdata['share_image']=$jy_weishop['share_image'];
		$postdata['share_desc']=$jy_weishop['share_desc'];
		$postdata['share_keywords']=$jy_weishop['share_keywords'];
		$postdata['toplogo']=$jy_weishop['toplogo'];
		$postdata['pluginnav']=$jy_weishop['pluginnav'];
		$postdata['ismerch']=$jy_weishop['ismerch'];
		$postdata['isnomerch']=$jy_weishop['isnomerch'];
		$postdata['isgoodstwo']=$jy_weishop['isgoodstwo'];
		$postdata['isrecommand']=$jy_weishop['isrecommand'];
		$postdata['islikegoods']=$jy_weishop['islikegoods'];
		$postdata['isnewgoods']=$jy_weishop['isnewgoods'];
		$postdata['islivebankuai']=$jy_weishop['islivebankuai'];
		$postdata['iscoupon']=$jy_weishop['iscoupon'];
		$postdata['iscube']=$jy_weishop['iscube'];
		$postdata['isbankuai1']=$jy_weishop['isbankuai1'];
		$postdata['isswiper']=$jy_weishop['isswiper'];
		$postdata['noticeimg']=$jy_weishop['noticeimg'];
		$postdata['isnotice']=$jy_weishop['isnotice'];
		$postdata['ishdps']=$jy_weishop['ishdps'];
		$postdata['issearch']=$jy_weishop['issearch'];*/
		plugin('jy_weishop')->plugin_setting('setting',$postdata);
		$this->plugin_setting('setting',$mydiydata);
		exi('设置成功');
	}
	$item=plugin('jy_weishop')->plugin_setting('setting');
	$jy_huaqingshop=$this->plugin_setting('setting');
	$fields=array('indexvideo','indeximg','indeximgurl','hdps','cube','bankuai1','bankuai2','footernav','welcomehdps','share_title','share_image','share_desc','share_keywords','toplogo','pluginnav','ismerch','isnomerch','isgoodstwo','isrecommand','islikegoods',
	'isnewgoods','islivebankuai','iscoupon','iscube','isbankuai1','isswiper','noticeimg','isnotice','ishdps','issearch');
	$diydata=array_fields($fields,$jy_huaqingshop);
	$footernav = array(
			array('title'=>'首页','icon'=>'icon-shouye','color'=>'#cc99ff','action'=>'jy_huaqingshop/index/','image'=>'../addons/jy_weishop/resource/images/jy_weishoparticle.png'),
			array('title'=>'推荐','icon'=>'icon-viewlist','color'=>'#66cc99','action'=>'jy_weishop/goods.index/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'搜索','icon'=>'icon-compass','color'=>'#ff9933','action'=>'jy_weishop/shop.groups/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'订单','icon'=>'icon-manageorder','color'=>'#66cc66','action'=>'jy_weishop/order.list/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'我的','icon'=>'icon-wo1','color'=>'#FF83FA','action'=>'jy_weishop/member.index/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
	);
	$diydata['footernav'] =$diydata['footernav']?: $footernav;
	$item=array_merge($item,$diydata);
	$plugins = $this->plugins();
	$hdps =array(
		array('title'=>'首页','picurl'=>'../addons/jy_weishop/resource/images/mobile-hdp01.jpg','action'=>'/index/'),
		array('title'=>'全部','picurl'=>'../addons/jy_weishop/resource/images/mobile-hdp02.jpg','action'=>'/allplugins/'),
	);
	$item['hdps'] = !empty($item['hdps']) ? $item['hdps'] : $hdps;
	$cube =array(
		array('title'=>'首页','image'=>'../addons/jy_weishop/resource/images/cube01.jpg','action'=>'/index/'),
		array('title'=>'全部','image'=>'../addons/jy_weishop/resource/images/cube02.jpg','action'=>'/allplugins/'),
		array('title'=>'订单','image'=>'../addons/jy_weishop/resource/images/cube03.jpg','action'=>'jy_weishop/order.list/'),
		array('title'=>'我的','image'=>'../addons/jy_weishop/resource/images/cube04.jpg','action'=>'jy_weishop/member.index/'),
	);
	$item['cube'] = !empty($item['cube']) ? $item['cube'] : $cube;
	$bankuai1 =array(
		array('title'=>'关于我们','img'=>'../addons/jy_huaqingshop/resource/images/icon1.png','action'=>''),
		array('title'=>'视频介绍','img'=>'../addons/jy_huaqingshop/resource/images/icon2.png','action'=>''),
		array('title'=>'发展历史','img'=>'../addons/jy_huaqingshop/resource/images/icon3.png','action'=>''),
		array('title'=>'领导关怀','img'=>'../addons/jy_huaqingshop/resource/images/icon4.png','action'=>''),
		array('title'=>'新闻资讯','img'=>'../addons/jy_huaqingshop/resource/images/icon5.png','action'=>''),
		array('title'=>'加入我们','img'=>'../addons/jy_huaqingshop/resource/images/icon6.png','action'=>''),
		array('title'=>'成功案例','img'=>'../addons/jy_huaqingshop/resource/images/icon7.png','action'=>''),
		array('title'=>'健康管理','img'=>'../addons/jy_huaqingshop/resource/images/icon8.png','action'=>''),
		array('title'=>'合作伙伴','img'=>'../addons/jy_huaqingshop/resource/images/icon9.png','action'=>''),
		array('title'=>'互医疗','img'=>'../addons/jy_huaqingshop/resource/images/icon10.png','action'=>''),
	);
	$bankuai2 =array(
		array('title'=>'每日清仓','img'=>'../addons/jy_weishop/resource/mobile/images/icon/qingcang.png','action'=>'jy_weishop/index/'),
		array('title'=>'品牌馆','img'=>'../addons/jy_weishop/resource/mobile/images/icon/pinpai.png','action'=>'jy_weishop/index/'),
		array('title'=>'9块9特卖','img'=>'../addons/jy_weishop/resource/mobile/images/icon/9.9.png','action'=>'jy_weishop/index/'),
		array('title'=>'找折扣','img'=>'../addons/jy_weishop/resource/mobile/images/icon/zhekou.png','action'=>'jy_weishop/index/'),
		array('title'=>'时尚穿搭','img'=>'../addons/jy_weishop/resource/mobile/images/icon/shishang.png','action'=>'jy_weishop/index/'),
		array('title'=>'爱逛街','img'=>'../addons/jy_weishop/resource/mobile/images/icon/guangjie.png','action'=>'jy_weishop/index/'),
		array('title'=>'食品超市','img'=>'../addons/jy_weishop/resource/mobile/images/icon/shopping.png','action'=>'jy_weishop/index/'),
		array('title'=>'电器城','img'=>'../addons/jy_weishop/resource/mobile/images/icon/jiadian.png','action'=>'jy_weishop/index/'),
		array('title'=>'领券中心','img'=>'../addons/jy_weishop/resource/mobile/images/icon/coupon.png','action'=>'jy_weishop/coupon.index/'),
		array('title'=>'全部分类','img'=>'../addons/jy_weishop/resource/mobile/images/icon/cate.png','action'=>'jy_weishop/allplugins/'),
	);
	$item['bankuai1'] = !$item['bankuai1']?$bankuai1:$item['bankuai1'];
	$item['demobankuai1'] = $bankuai1;
	$item['bankuai2'] = !$item['bankuai2']?$bankuai2:$item['bankuai2'];
	$pluginsactions=$this->pluginsactions(true);
	$pluginsactions_tuijie=array(
		array('title'=>'限时秒杀','img'=>'../core/resource/images/diy/icon/icon-miaosha.png','action'=>'jy_seckill/index/'),
		array('title'=>'超值拼团','img'=>'../core/resource/images/diy/icon/icon-ping.png','action'=>'jy_aligroup/index/'),
		array('title'=>'助力砍价','img'=>'../core/resource/images/diy/icon/icon-kanjia.png','action'=>'jy_bargain/index/'),
		array('title'=>'购物直播','img'=>'../core/resource/images/diy/icon/icon-live.png','action'=>'jy_weishop/sale.live_index/'),
		array('title'=>'领券中心','img'=>'../core/resource/images/diy/icon/icon_coupon.png','action'=>'jy_weishop/coupon.index/'),
	);
	$item['pluginsactions_tuijie']=$item['pluginsactions_tuijie']?:$pluginsactions_tuijie;
	$item['pluginsactions_title0']=$item['pluginsactions_title0']?:$pluginsactions[0]['title'];
	$item['pluginsactions_list0']=$item['pluginsactions_list0']?:$pluginsactions[0]['list'];
	$item['pluginsactions_title1']=$item['pluginsactions_title1']?:$pluginsactions[1]['title'];
	$item['pluginsactions_list1']=$item['pluginsactions_list1']?:$pluginsactions[1]['list'];
	$item['pluginsactions_title2']=$item['pluginsactions_title2']?:$pluginsactions[2]['title'];
	$item['pluginsactions_list2']=$item['pluginsactions_list2']?:$pluginsactions[2]['list'];
	$item['pluginsactions'] = $pluginsactions;
	$pluginnav=array();
	foreach($pluginsactions as $type){
		foreach($type['list'] as &$p){
				$pluginnav[]=$p;
		}
	}
	//$pluginnav=array_reverse($pluginnav);
	$pluginnav[]=array('title'=>'全部分类','img'=>'../core/resource/images/diy/icon/icon-1.png','action'=>'jy_weishop/allplugins/');
	$item['pluginnav'] = (!$item['pluginnav'] && !$item['footernav'])?$pluginnav:$item['pluginnav'];
	$my_days = array(
			array('title'=>'我的优惠券','icon'=>'icon-youhuiquan','color'=>'#cc99ff','action'=>'jy_weishop/coupon.myindex/'),
			array('title'=>'微信会员卡','icon'=>'icon-daifahuo','color'=>'#cc99ff','action'=>'core/member.wxcard/main/'),
			array('title'=>'余额提现','icon'=>'icon-dixiaofei','color'=>'#cc99ff','action'=>'core/member.tixian/'),
			array('title'=>'地址管理','icon'=>'icon-position','color'=>'#cc99ff','action'=>'core/member.address/'),
			array('title'=>'帮助中心','icon'=>'icon-help','color'=>'#cc99ff','action'=>'jy_weishop/news.list/'),
			array('title'=>'获得购物卡','icon'=>'icon-qiangdan','color'=>'#cc99ff','action'=>'jy_weishop/member.getcard/'),
			array('title'=>'我的购物车','icon'=>'icon-gouwuche','color'=>'#cc99ff','action'=>'jy_weishop/member.cart/'),
			array('title'=>'我的购物卡','icon'=>'icon-pingzhengzhongxin','color'=>'#cc99ff','action'=>'jy_weishop/member.mycard/'),
			array('title'=>'我的关注','icon'=>'icon-woguanzhudepinpai','color'=>'#cc99ff','action'=>'jy_weishop/member.favorite/'),
			array('title'=>'我的足迹','icon'=>'icon-zuji','color'=>'#cc99ff','action'=>'jy_weishop/member.history/'),
			array('title'=>'门店列表','icon'=>'icon-lianxishangjia','color'=>'#cc99ff','action'=>'jy_weishop/store.index/'),
	);
	$item['my_days'] = !empty($item['my_days']) ? $item['my_days'] : $my_days;
	$item['demomy_days'] = $my_days;
	$my_logs = array(
			array('title'=>'积分日志','icon'=>'icon-jifen','color'=>'#cc99ff','action'=>'core/member.credit_log/'),
			array('title'=>'余额日志','icon'=>'icon-jiangjiatongzhi','color'=>'#cc99ff','action'=>'core/member.credit_log/'),
			array('title'=>'提现日志','icon'=>'icon-trade','color'=>'#cc99ff','action'=>'core/member.cash_log/'),
			array('title'=>'红包日志','icon'=>'icon-ai-hongbao','color'=>'#cc99ff','action'=>'core/member.red_log/'),
	);
	$item['my_logs'] = !empty($item['my_logs']) ? $item['my_logs'] : $my_logs;
	$item['demomy_logs'] = $my_logs;
	$my_memberbtn = array(
			array('title'=>'小程序直播','icon'=>'icon-video','color'=>'#cc99ff','action'=>'jy_weishop/sale.live_index/'),
			array('title'=>'领取优惠券','icon'=>'icon-youhuiquan1','color'=>'#cc99ff','action'=>'jy_weishop/coupon.index/'),
			array('title'=>'领取微信会员卡','icon'=>'icon-huiyuanqia','color'=>'#cc99ff','action'=>'core/member.wxcard/main'),
			array('title'=>'积分排行','icon'=>'icon-paixing','color'=>'#cc99ff','action'=>'jy_weishop/member.rank/'),
	);
	$install = check_account_permission('jy_commission');
	if($install && $_SESSION['current_plugin'] !='jy_friends_shop'){
		$fenxiaoset=plugin('jy_commission')->plugin_setting('page_setting');
		$my_memberbtn[]=array('action'=>'jy_commission/index/','title'=>$fenxiaoset['tcenter']?:'我的分销','icon'=>'icon-paihao0','remark'=>'');
	}
	$install = check_account_permission('jy_merch');
	if($install && $_SESSION['current_plugin'] !='jy_friends_shop'){
		$my_memberbtn[]=array('action'=>'jy_merch/manage.index/','title'=>'商户入口','icon'=>'icon-dianpu','remark'=>'');
	}
	$install = check_account_permission('jy_giftbao');
	if($install && $_SESSION['current_plugin'] !='jy_friends_shop'){
		$my_memberbtn[]=array('action'=>'jy_weishop/sale.mylibao/','title'=>'我的礼包','icon'=>'icon-gifts','remark'=>'');
	}
	$install = $this->plugin_exists('jy_area_agent');
	if($install){
		$area_set=plugin('jy_area_agent')->plugin_setting('setting');
		if($area_set['member_show']){
			$jy_area_agenttitle=plugin('jy_area_agent')->plugin_setting('page')['agent_title']?:'区域代理';
			$my_memberbtn[]=array('action'=>'jy_area_agent/index/','title'=>$jy_area_agenttitle,'icon'=>'icon-paihao0','remark'=>'');
		}
	}
	$install = $this->plugin_exists('jy_globonus');
	if($install && $_SESSION['current_plugin'] !='jy_friends_shop'){
		$jy_globonus=plugin('jy_globonus')->plugin_setting('setting');
		if($jy_globonus['home']){
			$my_memberbtn[]=array('action'=>'jy_globonus/index/','title'=>'股东中心','icon'=>'icon-paihao0','remark'=>'');
		}
	}
	$install = $this->plugin_exists('jy_area_dian');
	if($install && $_SESSION['current_plugin'] !='jy_friends_shop'){
		$jy_area_dian=plugin('jy_area_dian')->plugin_setting('setting');
		if($jy_area_dian['member_show']){
			$my_memberbtn[]=array('action'=>'jy_area_dian/index/','title'=>'自提商入口','icon'=>'icon-paihao0','remark'=>'');
		}
	}
	$item['my_memberbtn'] = !empty($item['my_memberbtn']) ? $item['my_memberbtn'] : $my_memberbtn;
	$item['demomy_memberbtn'] = $my_memberbtn;
	foreach($item['footernav'] as &$ifv){
		$ifv['type']=intval($ifv['type']);
	}
	$welcomehdps =array(
					array('title'=>'他们都在用H5微商城','desc'=>'解决开店问题 助力小程序/H5/PC商城一体化','picurl'=>'../core/resource/images/welcomehdp01.jpg'),
					array('title'=>'粉丝变渠道商 激活圈内用户','desc'=>'分销加盟模式，让运营成为一种享受','picurl'=>'../core/resource/images/welcomehdp02.jpg'),
					array('title'=>'各种运营场景体 供你选择','desc'=>'根据自己的运营场景，个性组合搭建','picurl'=>'../core/resource/images/welcomehdp03.jpg'),
					array('title'=>'海量个性营销功能 助力市场激活','desc'=>'活跃，激活，促交面面俱到 让营销不在乏味','picurl'=>'../core/resource/images/welcomehdp04.jpg'),
	);
	$item['welcomehdps'] = !empty($item['welcomehdps']) ? $item['welcomehdps'] : $welcomehdps;
	$item['detail_tpl']=$item['detail_tpl']?:'0';
	$item['syscolor']=pdo_getcolumn('core_accounts',array('uniacid'=>$_SESSION['uniacid']),'syscolor');
    $return['item']=$item;
	$return['item']['plugins']=$return['item']['plugins']?$return['item']['plugins']:$plugins[1]['list'];
	$return['status']=array('1'=>'开启','0'=>'关闭');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'设置',
		'edit_tab'=>true,
		'edits'=>array(
				array(
					'title'=>'基本设置',
					'list'=>array(
						array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
						array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
						array('type'=>'text','title'=>'分享描述','name'=>'share_desc'),
						array('type'=>'text','title'=>'页面Keywords','name'=>'share_keywords'),
						array('type'=>'video','title'=>'首页视频','name'=>'indexvideo'),
						array('type'=>'image','title'=>'首页广告图片','name'=>'indeximg'),
						array('type'=>'string','title'=>'首页广告链接','name'=>'indexurl'),
						array('type'=>'string','title'=>'自定义购买按钮','name'=>'buy_title','help'=>'默认《立刻购买》'),
						array('type'=>'string','title'=>'自定义加入购物车','name'=>'cart_title','help'=>'默认《加入购物车》'),
						array('type'=>'string','title'=>'自定义商品价格前缀','name'=>'price_title','help'=>'比如：VIP价，双11价，默认不显示'),
						array('type'=>'text','title'=>'自定义样式','name'=>'diy_css'),
					)
				),
				array(
					'title'=>'风格',
					'list'=>array(
						array('type'=>'tip','title'=>'【温馨提示】：默认是新风格模式，可以自由切换成老的风格！'),
						array('type'=>'image','title'=>'首页顶部LOGO','name'=>'toplogo'),
						array('type'=>'radio_tpl','title'=>'商品详情风格','name'=>'detail_tpl','options'=>'detail_tpls'),
						array('type'=>'choose_many','name'=>'newvideogoods','title'=>'首页新品视频商品','action'=>'/goods.get_goods/many/isvideo=1','choose_title'=>'选择带视频的商品'),
					)
				),
				array(
					'title'=>'界面UI配色',
					'list'=>array(
						array('type'=>'color_pool','title'=>'选择配色方案','name'=>'syscolor','help'=>''),
						array('type'=>'colorpicker','title'=>'站点颜色','name'=>'syscolor','help'=>'自定义系统颜色系，默认： #18bc9c'),
						array('type'=>'phone_tpl','name'=>'syscolor'),
					)
				),
				array(
					'title'=>'幻灯片',
					'list'=>array(
						array('type'=>'array','name'=>'hdps','add_tip'=>'添加一个幻灯片',
								'list'=>array(
									array('type'=>'radio','name'=>'type','title'=>'显示','options'=>'hdptype'),
									array('type'=>'image','name'=>'picurl','title'=>'视频'),
									array('type'=>'string','name'=>'video','title'=>'视频'),									
									array('type'=>'string','name'=>'url','title'=>'地址'),
								),
								'details'=>array(
									array('type'=>'radio','name'=>'type','title'=>'显示','options'=>'hdptype'),
									array('type'=>'image','name'=>'picurl','title'=>'图片','help'=>'推荐尺寸：自适应'),
									array('type'=>'video','name'=>'video','title'=>'视频'),
									array('type'=>'link','name'=>'url','from'=>'action','title'=>'地址'),
									
								)
						),
					)
				),
				array(
					'title'=>'欢迎幻灯片',
					'list'=>array(
								array('type'=>'switch','title'=>'开启欢迎页面','name'=>'iswelcome','help'=>'开启后，访问首页会先进入欢迎页面！'),
								array('type'=>'array','title'=>'欢迎幻灯片','name'=>'welcomehdps','add_tip'=>'添加一个欢迎幻灯片',
										'list'=>array(
											array('type'=>'string','name'=>'title','title'=>'标题'),
											array('type'=>'image','name'=>'picurl','title'=>'图片'),
											array('type'=>'string','name'=>'url','title'=>'地址'),
										),
										'details'=>array(
											array('type'=>'string','name'=>'title','title'=>'标题'),
											array('type'=>'string','name'=>'desc','title'=>'描述'),
											array('type'=>'image','name'=>'picurl','title'=>'图片','help'=>'推荐尺寸：750*900'),
											array('type'=>'link','name'=>'url','from'=>'action','title'=>'地址'),
										)
								),
					)
				),
				array(
							'title'=>'板块导航1',
							'list'=>array(
									array('type'=>'updemo','name'=>'bankuai1','demo'=>'demobankuai1','title'=>'重置导航','help'=>'不知道添加什么导航？重置默认的一下试试！'),
									array('type'=>'array','name'=>'bankuai1','add_tip'=>'添加一个板块导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'image','name'=>'img','title'=>'导航图片'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'image','name'=>'img','title'=>'导航图片'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
							)
				),
				array(
							'title'=>'底部导航',
							'list'=>array(
								array('type'=>'tip','title'=>'
								[<red>温馨提示</red>]:
								</br>1、<red>底部菜单不变？</red>特别需要注意的是，手机端场景体的底部菜单显示机制。考虑到整个场景体的底部菜单应该是一样的（<red>就像小程序一样</red>），就是即使访问了一些其他插件的页面，底部菜单也应该显示当前场景体的。
								</br>2、<red>底部菜单跟访问的页面底部菜单不一致？</red>首次指定场景体，我们用current_plugin来指定，每次使用current_plugin=xxx的话，其中xxx是指场景插件的标识，就会刷新当前场景体的底部菜单。所以在使用过程中，可以留意一下，灵活使用。				
								</br>3、<red>刷新场景菜单示例：</red>例如：jy_weishop/index//<red>current_plugin=jy_weishop</red>就表示刷新场景菜单为商城的；
								</br>4、<red>为什么要统一底部菜单？</red>我们先想一个问题：如果很多应用的底部菜单，都包含了同一个页面，比如会员中心，<red>这时候你访问会员中心时，到底显示哪个应用的底部菜单呢？</red>这个时候就需要指定场景体，从而指定当前该显示什么底部菜单!
								'),	
								array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'switch','name'=>'isimg','title'=>'图片图标？'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'样式图标'),
										array('type'=>'image','name'=>'iconimg','title'=>'图片图标'),
										array('type'=>'radio','name'=>'type','title'=>'链接类型','options'=>'link_types'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'switch','name'=>'isimg','title'=>'图片图标？'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'样式图标','help'=>'图标，例如：icon-shouye','show'=>array('isimg'=>0)),
										array('type'=>'image','name'=>'iconimg','title'=>'图片图标','show'=>array('isimg'=>1)),	
										array('type'=>'radio','name'=>'type','title'=>'链接类型','options'=>'link_types','help'=>'【拨号】：输入电话号码；【扫码】：无需填任何内容（微信环境下才生效，而且微信公众号要JSDK域名授权）；'),
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接','show'=>array('type'=>0)),
										array('type'=>'string','name'=>'action','title'=>'电话号码','show'=>array('type'=>1)),
									)
								),
							)
				),
				array(
					'title'=>'页面开关设置',
					'list'=>array(
						array('type'=>'switch','title'=>'关闭漂浮客服按钮','name'=>'nokefu','help'=>'这里将全局显示客服按钮（浮动页面右下角），客服指向设置：移步--设置--基础设置--联系我们（H5端客服类型，小程序端客服类型）'),
						array('type'=>'switch','title'=>'关闭幻灯片','name'=>'ishdps'),
						array('type'=>'switch','title'=>'关闭公告栏','name'=>'isnotice'),
						array('type'=>'image','title'=>'公告栏图标','name'=>'noticeimg'),
						array('type'=>'switch','title'=>'关闭板块导航1','name'=>'isbankuai1'),
						array('type'=>'switch','title'=>'关闭分类板块','name'=>'groups'),
						array('type'=>'switch','title'=>'关闭未支付弹窗','name'=>'no_ordermodal'),
						//array('type'=>'switch','title'=>'关闭弹幕','name'=>'no_tanmu'),
						array('type'=>'switch','title'=>'关闭商品详情页商品推荐','name'=>'no_itemhot'),
						array('type'=>'switch','title'=>'关闭开通会员卡显示','name'=>'no_vipshow'),
						array('type'=>'switch','title'=>'关闭定位功能','name'=>'no_location','help'=>'关闭后，不再主动获取客户地理位置！'),
						array('type'=>'switch','title'=>'关闭商品海报','name'=>'no_poster','help'=>'关闭后，商品页面不显示商品海报！'),
						array('type'=>'switch','title'=>'关闭为你推荐','name'=>'no_typegoodstop','help'=>'关闭后，首页的底部商品列表上面的（为你推荐/便宜好货/特价活动）选项不显示！'),
						array('type'=>'switch','title'=>'是否显示DIYhtml/wxml？','name'=>'is_diyhtml','isradio'=>1),
						array('type'=>'text','title'=>'自定义html','name'=>'diy_html','help'=>'H5中生效！显示在为你推荐上面！'),
						array('type'=>'text','title'=>'自定义wxml','name'=>'diy_wxml','help'=>'小程序中生效！显示在为你推荐上面！'),
						array('type'=>'switch','title'=>'关闭商品列表页顶部分类','name'=>'no_goodslistgoup'),
					)
				),
				array(
					'title'=>'会员中心页面开关设置',
					'list'=>array(
						array('type'=>'tip','title'=>'如需DIY会员中心页面：移步DIY装修--添加页面--页面类型--选择会员中心'),
						array('type'=>'switch','title'=>'关闭现金红包显示','name'=>'no_xianred'),
						array('type'=>'switch','title'=>'关闭余额显示','name'=>'no_credit2'),
						array('type'=>'switch','title'=>'关闭我的订单','name'=>'no_order'),
						array('type'=>'switch','title'=>'关闭待激活商品','name'=>'no_verify'),
						array('type'=>'switch','title'=>'关闭我的日常','name'=>'no_days'),
						array('type'=>'switch','title'=>'关闭售后客服','name'=>'no_shkefu'),
						array('type'=>'switch','title'=>'关闭投诉建议','name'=>'no_tousu'),
						array('type'=>'switch','title'=>'关闭我的核销','name'=>'no_hexiao'),
						array('type'=>'updemo','name'=>'my_days','demo'=>'demomy_days','title'=>'重置我的日常','help'=>'不知道添加什么我的日常？重置默认的一下试试！'),
						array('type'=>'array','title'=>'我的日常','name'=>'my_days','add_tip'=>'添加一个我的日常',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'日常名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'日常图标'),
										array('type'=>'string','name'=>'action','title'=>'日常链接'),
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'日常名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'日常图标'),
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'日常链接'),
									)
						),
						array('type'=>'switch','title'=>'关闭我的记录','name'=>'no_logs'),
						array('type'=>'updemo','name'=>'my_logs','demo'=>'demomy_logs','title'=>'重置我的记录','help'=>'不知道添加什么我的记录？重置默认的一下试试！'),
						array('type'=>'array','title'=>'我的记录','name'=>'my_logs','add_tip'=>'添加一个我的记录',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'记录名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'记录图标'),
										array('type'=>'string','name'=>'action','title'=>'记录链接'),
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'记录名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'记录图标'),
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'记录链接'),
									)
						),
						array('type'=>'tip','title'=>'其他导航列表'),
						array('type'=>'switch','title'=>'关闭其他导航','name'=>'no_others'),
						array('type'=>'updemo','name'=>'my_memberbtn','demo'=>'demomy_memberbtn','title'=>'重置导航','help'=>'不知道添加什么导航？重置默认的一下试试！'),
						array('type'=>'array','title'=>'其他导航','name'=>'my_memberbtn','add_tip'=>'添加一个导航按钮',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
						),
					)
				),
				array(
				'title'=>'全部分类(百宝箱)设置',
					'list'=>array(
								array('type'=>'copy','name'=>'allpluginsurl','title'=>'全部分类入口'),
								array('type'=>'ewm','name'=>'allpluginsurl','title'=>'全部分类入口'),
								array('type'=>'tip','title'=>'【温馨提示】：下面的设置，只对全部分类页面有效，跟会员中心的菜单设置没任何关系！'),
								array('type'=>'array','title'=>'推荐','name'=>'pluginsactions_tuijie','add_tip'=>'添加一个推荐',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'名称'),
										array('type'=>'image','name'=>'img','title'=>'图标'),
										array('type'=>'string','name'=>'action','title'=>'路径'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'名称'),
										array('type'=>'image','name'=>'img','title'=>'图标'),
										array('type'=>'link','from'=>'action','name'=>'action','title'=>'路径'),
									)
								),
								array('type'=>'string','name'=>'pluginsactions_title0','title'=>'特色购物重命名'),
								array('type'=>'array','title'=>'特色购物','name'=>'pluginsactions_list0','add_tip'=>'添加一个特色购物',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'名称'),
										array('type'=>'icon','from'=>'jinyunicon','name'=>'icon','title'=>'图标'),
										array('type'=>'string','name'=>'action','title'=>'路径'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'名称'),
										array('type'=>'icon','from'=>'jinyunicon','name'=>'icon','title'=>'图标'),
										array('type'=>'link','from'=>'action','name'=>'action','title'=>'路径'),
									)
								),
								array('type'=>'string','name'=>'pluginsactions_title1','title'=>'活动购物重命名'),
								array('type'=>'array','title'=>'活动购物','name'=>'pluginsactions_list1','add_tip'=>'添加一个特色购物',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'名称'),
										array('type'=>'icon','from'=>'jinyunicon','name'=>'icon','title'=>'图标'),
										array('type'=>'string','name'=>'action','title'=>'路径'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'名称'),
										array('type'=>'icon','from'=>'jinyunicon','name'=>'icon','title'=>'图标'),
										array('type'=>'link','from'=>'action','name'=>'action','title'=>'路径'),
									)
								),
								array('type'=>'string','name'=>'pluginsactions_title2','title'=>'我的日常重命名'),
								array('type'=>'array','title'=>'我的日常','name'=>'pluginsactions_list2','add_tip'=>'添加一个特色购物',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'名称'),
										array('type'=>'icon','from'=>'jinyunicon','name'=>'icon','title'=>'图标'),
										array('type'=>'string','name'=>'action','title'=>'路径'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'名称'),
										array('type'=>'icon','from'=>'jinyunicon','name'=>'icon','title'=>'图标'),
										array('type'=>'link','from'=>'action','name'=>'action','title'=>'路径'),
									)
								),
					)
				),
			)
	);
	$return['hdptype']=array('图片','视频');
	$return['link_types']=link_types();
	$return['item']['allpluginsurl']=custom_url('jy_weishop/allplugins/',true);
	$return['htmls']=$htmls;
	$return['is_installs']=array('0'=>'不显示','1'=>'显示');
	$return['index_tpls']=array(
		array('id'=>0,'title'=>'A3风格','image'=>'../addons/jy_weishop/resource/images/tpl00.png'),
		array('id'=>1,'title'=>'A1风格','image'=>'../addons/jy_weishop/resource/images/tpl01.png'),
		array('id'=>2,'title'=>'A2风格','image'=>'../addons/jy_weishop/resource/images/tpl02.png'),
	);
	$return['detail_tpls']=array(
		array('id'=>0,'title'=>'默认风格','image'=>'../addons/jy_weishop/resource/images/d_tpl00.png'),
		array('id'=>1,'title'=>'咨询付费','image'=>'../addons/jy_weishop/resource/images/d_tpl01.png'),
	);
	exi($return);
}
if($_RQ['op']=='chooseplugins'){
	$list = pdo_getall('core_plugins',array('hide'=>0),array('id','style','name','title','image','description'),'id');
	if($list){
		foreach($list as $k=>&$item){
			if(!check_permission($item['name'])){
				unset($list[$k]);
			}else{
				$item['plugininfo'] = array('name'=>$item['name'],'title'=>$item['title'],'description'=>$item['description']);
			}
			
		}
	}
	$return['list']=$list;
	$return['htmls']=array(
		'type'=>'list',
		'list'=>array('data'=>'list','edit'=>false,'delall'=>false,'del_one'=>false,'pagelist'=>false,'list'=>array(
			array('name'=>'title','title'=>'名称','type'=>'string'),
		),'action'=>array(
			array('type'=>'modal_result','name'=>'name','title'=>'选取'),
		)),
		'search_one'=>array('name'=>'title','add'=>false),
	);
	exi($return);
}
?>